package com.zhiying.web.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class HttpServletUtils {

    public static String getLocalUrl(HttpServletRequest request){
        String ip = request.getHeader("X-Forwarded-For");
        return ip;
    }

    public static Object getSessionObject(HttpServletRequest request, String sessionId){
        HttpSession session = request.getSession(true);
        if(session == null){
            return null;
        }
        Object object = session.getAttribute(sessionId);
        return object;
    }


}
